#include<iostream>
using namespace std;
const int N = 1e4 + 10;
int f[N];
int n, m;
int main()
{
	cin >> n >> m;
	int v;
	f[0] = 1;
	for (int i = 0; i < n; i++) {
		cin >> v;
		for (int j = m; j >= v; j--) {
			f[j] += f[j - v];
		}
	}
	cout << f[m] << endl;
	return 0;
}